package com.why.jvm.hotspot.src.share.vm.oops.constants;

import lombok.Data;



/**
 * @author xiaoTian
 * @date 2022/7/22 14:24
 * @Description:
 */
@Data
public class ConstantInterfaceMethodrefInfo extends ConstantInfoBase {


    private int classIndex;

    private int nameAndTypeIndex;

    private String getClassName(){
        return ((ConstantUtf8Info)getConstantPool().getConstantPoolMap().get(classIndex)).getValue();
    }

    private String getNameAndType(){
        return ((ConstantUtf8Info)getConstantPool().getConstantPoolMap().get(nameAndTypeIndex)).getValue();
    }

    @Override
    public String toString() {
        return "ConstantInterfaceMethodrefInfo{" +
                ", classIndex=" + classIndex +
                ", nameAndTypeIndex=" + nameAndTypeIndex +
                ",className=" + getClassName() +
                ", nameAndType=" + getNameAndType() +
                '}';
    }
}
